#ifndef GAMEHISTORYMODEL_H
#define GAMEHISTORYMODEL_H

#include <QAbstractListModel>
#include <QObject>
#include "gamehistory.h"

class GameHistoryModel : public QAbstractListModel
{
public:
    explicit GameHistoryModel(QObject *parent = nullptr);
    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
    QHash<int, QByteArray> roleNames() const;

    enum GameHistoryRoles {
        HeroIDRole = Qt::UserRole + 1,
        DateRole,
        ResultRole,
        KDARole
    };

    void reset(QList<GameHistory> data);
private:
    QList<GameHistory> m_data;
};

#endif // GAMEHISTORYMODEL_H
